<?php if(!defined('BASEPATH')) exit('No direct script access allowed');

if (!function_exists('version_compare')||version_compare(phpversion(),'5','<'))require('./editor/fckeditor_php4.php');
else require('./editor/fckeditor_php5.php');

class editor
{
	public function create($arr=array())
	{
		if(isset($arr['name'])&&($arr['name']!=NULL)) $oFCKeditor = new FCKeditor($arr['name']);
		else $oFCKeditor = new FCKeditor('noidung');
		if(isset($arr['path'])&&($arr['path']!=NULL)) $oFCKeditor->BasePath = $arr['basepath'];
		if(isset($arr['width'])&&($arr['width']!=NULL)) $oFCKeditor->Width = $arr['width'];
		if(isset($arr['height'])&&($arr['height']!=NULL)) $oFCKeditor->Height = $arr['height'];
		if(isset($arr['toolbar'])&&($arr['toolbar']!=NULL)) $oFCKeditor->ToolbarSet = $arr['toolbar'];//Default, Basic
		if(isset($arr['value'])&&($arr['value']!=NULL)) $oFCKeditor->Value = $arr['value'];
		return $oFCKeditor->Create();
	}
}